package com.jeecg.p3.commonluckymoney.dao;

import com.jeecg.p3.commonluckymoney.entity.WxActCommonluckymoneyAwards;
import org.apache.ibatis.annotations.Param;
import org.jeecgframework.p3.core.utils.common.PageQuery;
import org.jeecgframework.p3.core.utils.common.PageQueryWrapper;
import org.jeecgframework.p3.core.utils.persistence.GenericDao;

import java.util.List;

/**
 * 描述：</b>WxActCommonluckymoneyAwardsDao<br>
 * @author：pituo
 * @since：2015年12月08日 16时43分33秒 星期二 
 * @version:1.0
 */
public interface WxActCommonluckymoneyAwardsDao extends GenericDao<WxActCommonluckymoneyAwards>{
	
	public Integer count(PageQuery<WxActCommonluckymoneyAwards> pageQuery);
	
	public List<WxActCommonluckymoneyAwards> queryPageList(PageQueryWrapper<WxActCommonluckymoneyAwards> wrapper);
	/**
	 * 更新卡券数量,数量减一
	 * @param id
	 */
	public void updateRemainNum(@Param("id")String id);
	
	public List<WxActCommonluckymoneyAwards> queryAwardsByActIdAndCurrDate(@Param("actId")String actId,@Param("date")String date);
	
	/**
	 * 查询该活动下的奖品
	 * @param actId
	 * @return
	 */
	public List<WxActCommonluckymoneyAwards> queryAwardsByActId(@Param("actId")String actId);
	
	/**
	 * 删除老数据
	 * @param ids
	 * @param actId
	 */
	public void bactchDeleteOldAwards(@Param("ids")List<String> ids,@Param("actId")String actId) ;
	
	/**
	 * 更新awards数量
	 * @param id
	 * @param num
	 */
	public Integer updateAwardsNum(@Param("id")String id,@Param("num")Integer num);

	public List<WxActCommonluckymoneyAwards> queryByActIdAndIds(
			@Param("ids")List<String> ids, @Param("actId")String actId);
}

